package com.mobilesalon.backup;

import java.io.IOException;

import android.app.backup.BackupAgentHelper;
import android.app.backup.BackupDataInput;
import android.app.backup.BackupDataOutput;
import android.app.backup.FileBackupHelper;
import android.os.ParcelFileDescriptor;
import android.util.Log;

import com.mobilesalon.provider.DBOpenHelper;

public class GoogleBackupAgent extends BackupAgentHelper {

	private static final String TAG = GoogleBackupAgent.class.getName();

	@Override
	public void onCreate() {

		FileBackupHelper dbBackupHelper = new FileBackupHelper(this, "../databases/"
				+ DBOpenHelper.DB_NAME);
		this.addHelper(DBOpenHelper.DB_NAME, dbBackupHelper);
		
	}

	@Override
	public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
			ParcelFileDescriptor newState) throws IOException {
		super.onBackup(oldState, data, newState);
		Log.d(TAG, "onBackup");
	}

	@Override
	public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
			throws IOException {
		super.onRestore(data, appVersionCode, newState);
		Log.d(TAG, "onRestore");

	}

}
